<<<<<<< HEAD
﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include"game.h"



void meun()
{
	printf("******************\n");
	printf("******************\n");
	printf("*******1.piay*****\n");
	printf("*******0.exit*****\n");
	printf("******************\n");
	printf("******************\n");
}


void game()
{
	char ret ;
	char board[ROW][COL] = { 0 };
	//初始化棋盘的功能
	InitBoard(board, ROW, COL);
	//打印棋盘
	DisplayBoard(board, ROW, COL);
	
	while (1)
	{	
		//玩家下棋
		PlayerMove(board, ROW, COL);
		//判断输赢
		ret = IsWin(board,ROW,COL);
			
		if (ret != 'C')
		{
			break;
		}
		
		DisplayBoard(board, ROW, COL);
		
		//AI下棋
		AI_Move(board, ROW, COL);
		ret = IsWin(board, ROW, COL);
		if (ret != 'C')
		{
			break;
		}
		//判断输赢
		
		DisplayBoard(board, ROW, COL);
	}
	if (ret=='#')
	{
		
			printf("恭喜你获得胜利ヾ(≧▽≦*)o\n");
			
		}
	else if(ret=='*')
		{
		
			printf("你失败了，AI获胜(っ °Д °;)っ\n");
		
		}
		else if(ret=='Q')
	{
		
			printf("平局，（︶^︶）\n");
			
		}
	
	DisplayBoard(board, ROW, COL);
}

int main()
{
	srand((unsigned int)time(NULL));
	
	int input = 0;
	do
	{	
		meun();
		printf("请选择:>");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("退出游戏\n");
			break;
		default:
			printf("选择错误!（；´д｀）ゞ\n");
			break;
		}
	
	
	} while (input);


	return 0;
}

=======
﻿#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include"game.h"



void meun()
{
	printf("******************\n");
	printf("******************\n");
	printf("*******1.piay*****\n");
	printf("*******0.exit*****\n");
	printf("******************\n");
	printf("******************\n");
}


void game()
{
	char ret ;
	char board[ROW][COL] = { 0 };
	//初始化棋盘的功能
	InitBoard(board, ROW, COL);
	//打印棋盘
	DisplayBoard(board, ROW, COL);
	
	while (1)
	{	
		//玩家下棋
		PlayerMove(board, ROW, COL);
		//判断输赢
		ret = IsWin(board,ROW,COL);
			
		if (ret != 'C')
		{
			break;
		}
		
		DisplayBoard(board, ROW, COL);
		
		//AI下棋
		AI_Move(board, ROW, COL);
		ret = IsWin(board, ROW, COL);
		if (ret != 'C')
		{
			break;
		}
		//判断输赢
		
		DisplayBoard(board, ROW, COL);
	}
	if (ret=='#')
	{
		
			printf("恭喜你获得胜利ヾ(≧▽≦*)o\n");
			
		}
	else if(ret=='*')
		{
		
			printf("你失败了，AI获胜(っ °Д °;)っ\n");
		
		}
		else if(ret=='Q')
	{
		
			printf("平局，（︶^︶）\n");
			
		}
	
	DisplayBoard(board, ROW, COL);
}

int main()
{
	srand((unsigned int)time(NULL));
	
	int input = 0;
	do
	{	
		meun();
		printf("请选择:>");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("退出游戏\n");
			break;
		default:
			printf("选择错误!（；´д｀）ゞ\n");
			break;
		}
	
	
	} while (input);


	return 0;
}

>>>>>>> 6d979a6ccebe994e02233c60ad4fd5e71b08f759
